#include "PrimitiveShape.h"

PrimitiveShape::PrimitiveShape(void)
{
}

PrimitiveShape::~PrimitiveShape(void)
{
}

void PrimitiveShape::drawBox(float lenth)
{

}

void PrimitiveShape::drawRectangle(float width, float height, float z)
{
	glPushMatrix();
	glBegin(GL_QUADS);
		glVertex3f(-width/2.f, -height/2.f, z);
		glVertex3f( width/2.f, -height/2.f, z);
		glVertex3f( width/2.f,  height/2.f, z);
		glVertex3f(-width/2.f,  height/2.f, z);
	glEnd();
	glPopMatrix();
}

void PrimitiveShape::drawLine(glm::vec3& p1, glm::vec3& p2)
{
	glPushMatrix();
	glBegin(GL_LINES);
		glVertex3f(p1.x, p1.y, p1.z);
		glVertex3f(p2.x, p2.y, p2.z);
	glEnd();
	glPopMatrix();
}

void PrimitiveShape::drawTriangle(glm::vec3& p1, glm::vec3& p2, glm::vec3& p3)
{
	glPushMatrix();
	glBegin(GL_TRIANGLES);
		glVertex3f(p1.x, p1.y, p1.z);
		glVertex3f(p2.x, p2.y, p2.z);
		glVertex3f(p3.x, p3.y, p3.z);
	glEnd();
	glPopMatrix();
}
